package com.imCode.web;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by GO FOR IT on 2020/4/17.
 */
@WebServlet("/s2")
public class Servlet02 extends HttpServlet {

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        System.out.println(request.getServletContext().getAttribute("s1"));

        request.getServletContext().removeAttribute("s1");

        System.out.println("---------------");
        System.out.println(getServletConfig().getInitParameter("s3"));
    }
}
